#include <asm/desc.h>
#include "context.h"

void save_context(struct cpu_context *cpu) {
  store_idt(&(cpu->idtr));
  cpu->cr3 = read_cr3();
}

void load_context(struct cpu_context *cpu) {
  write_cr3(cpu->cr3);
  load_idt(&(cpu->idtr));
}
